{include file='common/head'}
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">演示</a>
        <a href="">
          <cite>评论</cite></a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so" action="{:Url('Xinxi/pinglun')}" method="get">
            <input type="text" name="uname" value="{$Request.get.uname|default=''}"  placeholder="请输入评论用户" autocomplete="off" class="layui-input">
            <input type="text" name="evalute_id" value="{$Request.get.evalute_id|default=''}"  placeholder="请输入评论ID" autocomplete="off" class="layui-input">
            <input type="text" name="txt" value="{$Request.get.txt|default=''}"  placeholder="请输入评论内容" autocomplete="off" class="layui-input">
            <input class="layui-input" placeholder="开始日" value="{$Request.get.datemin|default=''}" name="datemin" id="start">至
            <input class="layui-input" placeholder="截止日" name="datemax"  value="{$Request.get.datemax|default=''}" id="end">
            <input type="submit" name="sub" class="layui-btn" value="开始搜索" lay-submit="" lay-filter="sreach">
            <a title="导出数据" href="{:url('index/xinxi/daopinglun')}" >
                <span class="layui-btn">导出数据</span>
            </a>
        </form>

    </div>
    <form class="layui-form" action="">
        <table class="layui-table">
            <thead>
            <tr>
                <th>NO</th>
                <th>评论ID</th>
                <th>评论内容</th>
                <th>信息ID</th>
                <th>发布人</th>
                <th>评论时间</th>
                <th>锁定</th>
            </thead>
            <tbody>
            {volist name="rs" id="rs"}
            <tr>
                <td>{$key+1}</td>
                <td>{$rs.evalute_id}</td>
                <td>
                    {if $rs.bpid==0}
                    <a title="查看" href="javascript:;" attr_id='{$rs.u_uid}' onclick="banner_edit(this)">
                        <span style="color: mediumblue">{if $rs.pl_name==''}{$rs.pl_nickname}{else/}{$rs.pl_name}{/if}</span>
                    </a>
                    &nbsp;&nbsp;:&nbsp;&nbsp;{$rs.txt};
                    {else/}
                    <a title="查看" href="javascript:;" attr_id='{$rs.u_uid}' onclick="banner_edit(this)">
                        <span style="color: mediumblue">{if $rs.pl_name==''}{$rs.pl_nickname}{else/}{$rs.pl_name}{/if}</span>
                    </a>&nbsp;&nbsp;回复&nbsp;&nbsp;<a title="查看" href="javascript:;" attr_id='{$rs.hf_uid}' onclick="banner_edit(this)">
                    <span style="color: mediumblue">{if $rs.hf_name==''}{$rs.hf_nickname}{else/}{$rs.hf_name}{/if}</span>
                </a>&nbsp;&nbsp;{$rs.txt};
                    {/if}
                </td>
                <td>
                    <a title="查看" href="javascript:;" attr_id='{$rs.message_id}' onclick="banner_editxinxi(this)"><span style="color: mediumblue">{$rs.message_id}</span>
                    </a>
                </td>
                <td><a title="查看" href="javascript:;" attr_id='{$rs.uid}' onclick="banner_edit(this)"><span style="color: mediumblue">{if $rs.uname==''}{$rs.nickname}{else/}{$rs.uname}{/if}</span></a></td>
                <td>{$rs.create_time}</td>
                <td class="td-manage">
                    <input type="checkbox" <?php if ($rs['sfig']==2): ?>  checked="" <?php endif; ?> name="status[]" lay-skin="switch" lay-filter="switchTest" lay-text="开启|关闭"/ value="{$rs.evalute_id}">
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>
        <div class="page">
            <div>
                {$page}
            </div>
        </div>
    </form>
</div>

<script>
    layui.use(['laydate','form'], function(){
        var laydate = layui.laydate;
        var form = layui.form;
        form.on('switch(switchTest)', function(data){
            var id = data.value;
            $.ajax({
                url: "{:url('index/xinxi/pinglunflg')}",
                type: "post",
                dataType: "JSON",
                data: {sid: id},
                success: function (res) {
                    if (res ==1) {
                        layer.msg('操作成功！');
                        //alert(11);
                        //location.reload();
                        return false;
                    } else {
                        layer.msg('操作失败！');
                        /*setTimeout(function () {
                            location.reload();
                        }, 1000);*/
                        return false;
                    }
                }
            });
        });


    });



    function delAll (argument) {

        var data = tableCheck.getData();

        layer.confirm('确认要删除吗？'+data,function(index){
            //捉到所有被选中的，发异步进行删除
            layer.msg('删除成功', {icon: 1});
            $(".layui-form-checked").not('.header').parents('tr').remove();
        });
    }
    function banner_edit(obj) {
        var mid=$(obj).attr('attr_id');
        // alert(mid);
        var url="{:Url('user/chakan')}?uid="+  mid;
        // alert(url);
        x_admin_show('查看',url);
    }

    function banner_editxinxi(obj) {
        var mid=$(obj).attr('attr_id');
        // alert(mid);
        var url="{:Url('xinxi/chakan')}?mid="+  mid;
        // alert(url);
        x_admin_show('查看',url);
    }

</script>

</body>

</html>